package com.junzhiit.nengji.dao.impl;

import org.springframework.stereotype.Repository;

import com.bainaeco.framework.base.dao.AbstractBaseDAO;
import com.bainaeco.framework.common.jdbc.StatementParameter;
import com.junzhiit.nengji.dao.ChainInfoDAO;
import com.junzhiit.nengji.model.ChainInfo;
import com.junzhiit.nengji.model.enums.Is;

@Repository
public class ChainInfoDAOImpl  extends AbstractBaseDAO<ChainInfo> implements ChainInfoDAO{

	@Override
	public ChainInfo findByChainId(String chainId) {
		StringBuffer sql=new StringBuffer();
		sql.append("select ci.*");
		sql.append(" from chain_info ci");
		sql.append(" where ci.is_delete=? and ci.chain_id=?");
		StatementParameter params=new StatementParameter();
		params.setInt(Is.NO.toIntValue());
		params.setString(chainId);
		return query(sql.toString(), ChainInfo.class, params);
	}

}
